// 用户模块的vuex的操作

export default {
  state: {
    token: JSON.parse(localStorage.getItem('hm-news-token')) || {}
  },
  getters: {},
  mutations: {
    setToken(state, payload) {
      state.token = payload

      // 把 token数据本地存储起来
      localStorage.setItem('hm-news-token', JSON.stringify(payload))
    }
  },
  actions: {}
}
